package com.leadingsoft.pwxk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.AuditAirPollutionEmissionsConverter;
import com.leadingsoft.pwxk.dto.AuditAirPollutionEmissionsDto;
import com.leadingsoft.pwxk.model.AuditAirPollutionEmissions;
import com.leadingsoft.pwxk.service.AuditAirPollutionEmissionsService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/** @author ysh */
@Api(description = "大气污染物排放信息相关")
@RestController
@RequestMapping("api/auditAirPollutionEmissions")
public class AuditAirPollutionEmissionsController {

	@Autowired
	AuditAirPollutionEmissionsService auditAirPollutionEmissionsService;
	@Autowired
	AuditAirPollutionEmissionsConverter auditAirPollutionEmissionsConverter;

	@ApiOperation("大气污染物排放信息")
	@GetMapping(path = "{dataid}")
	@ResponseStatus(code = HttpStatus.OK)
	public AuditAirPollutionEmissionsDto get(@PathVariable(value = "dataid") String dataId) {
		AuditAirPollutionEmissions auditAirPollutionEmissions = auditAirPollutionEmissionsService.getByDataId(dataId);
		return auditAirPollutionEmissionsConverter.toDto(auditAirPollutionEmissions);
	}
}
